<?php

//业务逻辑
namespace app\admin\logic;
 
use app\admin\model\InfoModel;

 
class InfoLogic {

    // 单页列表
    public static function get_list($page=1,$pagesize=10,$title)
    {
        $where[] = ['is_del','=',0];
        if(!empty($title)){
            $where[] = ['info_title','like','%'.$title.'%'];
        }
        $listorder = ['info_id'=>'asc'];
        // $list = $InfoModel->InfoList($where,$page,$pagesize,$listorder);
        $list=  InfoModel::where($where)
                ->order($listorder)
                ->paginate([
                    'list_rows'=>$pagesize,     //每页几条
                    'page'=>$page,              //当前页
                    // 'query'=>['title'=>$title]  //保存参数
                ]);
        return $list;
    }
}